package fs.ryj;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class UserDaoTest {
    UserDao userDao = new UserDao();

    @Before
    public void setUp() throws Exception {
        System.out.println("测试开始");
    }

    @After
    public void tearDown() throws Exception {
        System.out.println("测试结束");
    }

    @Test
    public void getAll() {
        assertNotNull(userDao.getAll());
    }

    @Test
    public void deleteUser() {
        assertTrue(userDao.deleteUser(new User(3, "王五")));
    }

    @Test
    public void add() {
        assertFalse(userDao.add(new User(4, "牛六")));
    }

    @Test
    public void update() {
        assertTrue(userDao.update(new User(1, "ryj")));
    }
}